package com.ruicar.afs.cloud.apply.common.feign;

import com.alibaba.fastjson.JSONObject;
import com.ruicar.afs.cloud.apply.common.dto.ApplyWechatDTO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 微信二维码
 *
 * @author 耿继辉
 */
@FeignClient(name = "apply", url = "${com.greatwall.systems.wechat-system.url}")
public interface ApplyWechatFegin {

    /**
     * 获取微信token
     *
     * @param data
     * @return
     */
    @ApiOperation("获取微信token")
    @GetMapping(value = "/cgi-bin/token")
    JSONObject getToken(@RequestParam Map<String, String> data);


    /**
     * 通过该接口生成的小程序码，永久有效，数量暂无限制
     * @param wechatDTO
     * @param data
     * @return
     */
    @ApiOperation("获取二维码")
    @PostMapping(value = "/wxa/getwxacodeunlimit")
    byte[] getScene(@RequestBody ApplyWechatDTO wechatDTO, @RequestParam Map<String, String> data);


}
